package com.itheima.service.impl;

import com.itheima.dao.UserDao;
import com.itheima.dao.impl.UserDaoImpl;
import com.itheima.factory.BeanFactory;
import com.itheima.factory.DaoFactory;
import com.itheima.service.UserService;

/**
 * @author wz
 * @description:
 * @date 2021-10-30
 */
public class UserServiceImpl implements UserService {
    @Override
    public void add() throws IllegalAccessException, InstantiationException, ClassNotFoundException {
        UserDao userDao= (UserDao) BeanFactory.getBean("userDao");
        //UserDao userDao= DaoFactory.getBean();
        userDao.add();
    }

    @Override
    public void update() {
        UserDao userDao = DaoFactory.getBean();
        userDao.update();
    }
}
